<?php
/**
 * Created by PhpStorm.
 * User: ytl003
 * Date: 2018/5/22
 * Time: 下午5:23
 */

namespace app\api\model;


class BuildingClass extends BaseModel
{
    public function buildingItems(){
        return $this->hasMany('Building','building_class_id','id');
    }

    public static function getBuilding(){
        return self::with(['buildingItems'])->order('order_id','asc')->select();
    }
}